﻿using System;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Status;
using System.Threading;

namespace AgilePokerCards
{
    static class Program
    {
        private static FormStart formStart;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [MTAThread]
        static void Main()
        {
            SystemState displayRotation = new SystemState(SystemProperty.DisplayRotation);
            displayRotation.Changed += displayRotation_Changed;

            formStart = new FormStart();
            Application.Run(formStart);

            Application.Exit();
        }

        private static void displayRotation_Changed(object sender, ChangeEventArgs args)
        {
            Thread.Sleep(250); // Wait a bit to give the device time to update the screen properly
            Helper.PlaceButtons(formStart);
        }
    }
}